package kr.co.fotosketch.spring.sample01_08.user;

import java.sql.SQLException;

import kr.co.fotosketch.spring.sample01_01.user.domain.User;
import kr.co.fotosketch.spring.sample01_08.user.dao.UserDao;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;

public class UserDaoTest {
	public static void main(String[] arg) throws ClassNotFoundException, SQLException {
		ApplicationContext context = new GenericXmlApplicationContext("kr/co/fotosketch/spring/sample01_08/user/dao/applicationContext.xml");
		UserDao userDao = context.getBean("userDao", UserDao.class);
		User user = userDao.getUser("bluemirr");
		System.out.println(user.getName());
		
		UserDao userDao1 = context.getBean("userDao", UserDao.class);
		UserDao userDao2 = context.getBean("userDao", UserDao.class);
		System.out.println("equal?");
		System.out.println(userDao1);
		System.out.println(userDao2);
		
	}
}
